/*     */ package nc.bs.pp.m28.maintain.rule.insert;
/*     */ 
/*     */ import nc.bs.ml.NCLangResOnserver;
/*     */ import nc.impl.pubapp.pattern.rule.IRule;
/*     */ import nc.vo.ml.NCLangRes4VoTransl;
/*     */ import nc.vo.pp.m28.entity.PriceAuditHeaderVO;
/*     */ import nc.vo.pp.m28.entity.PriceAuditItemVO;
/*     */ import nc.vo.pp.m28.entity.PriceAuditVO;
/*     */ import nc.vo.pubapp.pattern.exception.ExceptionUtils;
/*     */ import nccloud.commons.lang.StringUtils;
/*     */ import nccloud.commons.lang.SystemUtils;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class PriceAuditNotNullChkRule
/*     */   extends Object
/*     */   implements IRule<PriceAuditVO>
/*     */ {
/*     */   public void process(PriceAuditVO[] vos) {
/*  27 */     StringBuffer buffer = new StringBuffer();
/*  28 */     for (PriceAuditVO vo : vos) {
/*     */       
/*  30 */       PriceAuditHeaderVO headerVO = vo.getParentVO();
/*  31 */       if (null == headerVO) {
/*  32 */         buffer.append(NCLangResOnserver.getInstance().getStrByID("4005002_0", "04005002-0062"));
/*     */         
/*  34 */         buffer.append(SystemUtils.LINE_SEPARATOR);
/*     */       } else {
/*     */         
/*  37 */         StringBuffer headerVOBuffer = checkHeaderVO(headerVO);
/*  38 */         if (headerVOBuffer.length() != 0) {
/*  39 */           buffer.append(headerVOBuffer);
/*  40 */           buffer.append(SystemUtils.LINE_SEPARATOR);
/*     */         } 
/*     */       } 
/*     */       
/*  44 */       PriceAuditItemVO[] orderItemVOs = vo.getChildrenVO();
/*  45 */       if (null != orderItemVOs) {
/*  46 */         for (PriceAuditItemVO itemVO : orderItemVOs) {
/*  47 */           if (null == itemVO) {
/*  48 */             buffer.append(NCLangResOnserver.getInstance().getStrByID("4005002_0", "04005002-0063"));
/*     */             
/*  50 */             buffer.append(SystemUtils.LINE_SEPARATOR);
/*     */ 
/*     */           
/*     */           }
/*  54 */           else if (itemVO.getStatus() != 0 && itemVO
/*  55 */             .getStatus() != 3) {
/*     */ 
/*     */             
/*  58 */             StringBuffer itemVOBuffer = checkOrderItemVO(itemVO, headerVO);
/*  59 */             if (itemVOBuffer.length() != 0) {
/*  60 */               buffer.append(NCLangResOnserver.getInstance().getStrByID("4005002_0", "04005002-0064", null, new String[] { itemVO
/*     */                       
/*  62 */                       .getCrowno() }));
/*     */               
/*  64 */               buffer.append(itemVOBuffer);
/*     */             } 
/*     */           } 
/*     */         } 
/*     */       }
/*     */     } 
/*  70 */     if (buffer.length() != 0)
/*     */     {
/*  72 */       ExceptionUtils.wrappBusinessException(buffer.toString());
/*     */     }
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*  89 */   private void addErrorMsg(String msg, StringBuffer buffer) { buffer.append(msg); }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private StringBuffer checkHeaderVO(PriceAuditHeaderVO headerVO) {
/* 104 */     StringBuffer headerVOBuffer = new StringBuffer();
/* 105 */     if (StringUtils.isBlank(headerVO.getPk_org())) {
/* 106 */       addErrorMsg(
/* 107 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0033"), headerVOBuffer);
/*     */     }
/*     */     
/* 110 */     if (StringUtils.isBlank(headerVO.getPk_group())) {
/* 111 */       addErrorMsg(
/* 112 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0034"), headerVOBuffer);
/*     */     }
/*     */     
/* 115 */     if (StringUtils.isBlank(headerVO.getPk_org_v())) {
/* 116 */       addErrorMsg(
/* 117 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0035"), headerVOBuffer);
/*     */     }
/*     */     
/* 120 */     if (null == headerVO.getFbillstatus()) {
/* 121 */       addErrorMsg(
/* 122 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0038"), headerVOBuffer);
/*     */     }
/*     */ 
/*     */     
/* 126 */     return headerVOBuffer;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private StringBuffer checkOrderItemVO(PriceAuditItemVO orderItemVO, PriceAuditHeaderVO headerVO) {
/* 142 */     StringBuffer itemVOErrBuffer = new StringBuffer();
/* 143 */     if (StringUtils.isBlank(orderItemVO.getVspecialcode())) {
/* 144 */       addErrorMsg(
/* 145 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0039"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 148 */     if (StringUtils.isBlank(orderItemVO.getPk_org())) {
/* 149 */       addErrorMsg(
/* 150 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0033"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 153 */     if (StringUtils.isBlank(orderItemVO.getCorigcurrencyid())) {
/* 154 */       addErrorMsg(
/* 155 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0037"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 158 */     if (null == orderItemVO.getNexchangerate()) {
/* 159 */       addErrorMsg(
/* 160 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0077"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 163 */     if (StringUtils.isBlank(orderItemVO.getPk_org_v())) {
/* 164 */       addErrorMsg(
/* 165 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0035"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 168 */     if (StringUtils.isBlank(orderItemVO.getPk_group())) {
/* 169 */       addErrorMsg(
/* 170 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0040"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 173 */     if (StringUtils.isBlank(orderItemVO.getMaterial_save())) {
/* 174 */       addErrorMsg(
/* 175 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0041"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 178 */     if (StringUtils.isBlank(orderItemVO.getCunitid())) {
/* 179 */       addErrorMsg(
/* 180 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0042"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 183 */     if (orderItemVO.getFtaxtypeflag() == null) {
/* 184 */       addErrorMsg(
/* 185 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0043"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 188 */     if (orderItemVO.getVchangerate() == null) {
/* 189 */       addErrorMsg(
/* 190 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0044"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 193 */     if (orderItemVO.getCunitid() == null) {
/* 194 */       addErrorMsg(
/* 195 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0042"), itemVOErrBuffer);
/*     */     }
/*     */     
///* 198 */     if (orderItemVO.getNorigprice() == null) {
///* 199 */       addErrorMsg(
///* 200 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0045"), itemVOErrBuffer);
///*     */     }
///*     */     
///* 203 */     if (orderItemVO.getNorigtaxprice() == null) {
///* 204 */       addErrorMsg(
///* 205 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0046"), itemVOErrBuffer);
///*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/* 215 */     if (orderItemVO.getFpricetype() == null) {
/* 216 */       addErrorMsg(
/* 217 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0071"), itemVOErrBuffer);
/*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/* 225 */     if (orderItemVO.getCrececountryid() == null) {
/* 226 */       addErrorMsg(
/* 227 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0073"), itemVOErrBuffer);
/*     */     }
/*     */     
/* 230 */     if (orderItemVO.getCtaxcountryid() == null) {
/* 231 */       addErrorMsg(
/* 232 */           NCLangRes4VoTransl.getNCLangRes().getStrByID("4005002_0", "04005002-0074"), itemVOErrBuffer);
/*     */     }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/* 245 */     return itemVOErrBuffer;
/*     */   }
/*     */ }


/* Location:              E:\zhuhai_ncc\NCC2111\modules\purp\META-INF\lib\purp_priceaudit.jar!/nc/bs/pp/m28/maintain/rule/insert/PriceAuditNotNullChkRule.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.0.7
 */